<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加组织结构</title>
	<%@ include file="/app/includes/header.jsp"%>
	<script type="text/javascript">
		function addOrganization(){
			$('#organizationForm').submit();
		}
	</script>
</head>
<body>
	<div id="panel" class="easyui-panel" title="添加组织结构信息"
		icon="icon-add-form" collapsible="true" style="padding: 10px;">
		<form id="organizationForm" action="<%=request.getContextPath()%>/auth/organization/addOrganization.action" method="post">
			<table class="table-form">
			<tr>
				<td>
					标识:
				</td>
				<td>
					<input id="id" name="id"  type="text"></input>
				</td>
				<td >
					<div id="idTip"></div>
				</td>
			</tr>
			<tr>
				<td>
					名称:
				</td>
				<td>
					<input id="name" name="name" type="text"></input>
				</td>
				<td>
					<div id="nameTip"></div>
				</td>
			</tr>
			<tr>
				<td>
					描述:
				</td>
				<td>
					<input id="description" name="description" type="text"></input>
				</td>
				<td>
					<div id="descriptionTip" ></div>
				</td>
			</tr>
			<tr>
				<td>
					父资源:
				</td>
				<td>
					<input id="parentId" name="parentId" type="text" value="<%=request.getParameter("parentId")%>" readonly="readonly"></input>
				</td>
				<td>
				</td>
			</tr>
			<tr>
				<td colspan="3">
					<div style="padding: 10px;" >
					<a href="#" onclick="addOrganization()" class="easyui-linkbutton" 
						iconCls="icon-add">添加</a>
					<a href="javascript:history.back(-1)" class="easyui-linkbutton"  
						iconCls="icon-cancel">取消</a>
					</div>
				</td>
			</tr>
			</table>
		</form>
	</div>
</body>
	<script type="text/javascript">
		$(document).ready(function(){
		$.formValidator.initConfig({formid:"organizationForm"});
		$("#id").formValidator({
			onshow:"请输入标识",
			onfocus:"请正确填写名称，例如：数字，字母，小数点的组合",
			oncorrect:"正确"})
			.regexValidator({regexp:"resourceName",datatype:"enum",onerror:"请正确填写名称，例如：数字，字母，小数点的组合"});
		$("#name").formValidator({
			onshow:"请输入组织结构名称",
			onfocus:"请正确填写组织结构名称，例如：开发部",
			oncorrect:"正确"})
			.inputValidator({min:1,onerror:"名称不能为空！"});
		$("#description").formValidator({
			onshow:"请输入描述信息",
			onfocus:"请正确填写描述信息，例如：开发部",
			oncorrect:"正确"})
			.inputValidator({min:1,onerror:"描述信息不能为空！"});
		});
	</script>
</html>